#!/usr/bin/python
import re, sys

def sentences(text): return re.findall(r"[a-z,\-'\s]+[.!;?]", text.lower()) 

def main():
	text = sys.stdin.read()
	for sentence in sentences(text):
		words = re.split('\s+', sentence)
		print ' '.join(words)

if __name__ == "__main__":
    main()
